import { ChannelType } from '@/store/redurce/channel';
import request from '@/utils/request';

export const getChannelListAPI = () => {
  return request({
    url: '/v1_0/channels',
  });
};

export const getUserChannelListAPI = () => {
  return request({
    url: '/v1_0/user/channels',
  });
};

export const delUserChannelListAPI = (id: number) => {
  return request({
    url: '/v1_0/user/channels/' + id,
    method: 'DELETE',
  });
};

// 1. API
export const addUserChannelByIdAPI = (channelList: ChannelType[]) => {
  return request({
    url: '/v1_0/user/channels',
    method: 'PATCH',
    data: {
      channels: channelList,
    },
  });
};
